package com.face;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.SwingConstants;

public class TextAndPicButton extends JButton {
	private ImageIcon icon;
	private JButton labImage;
	public TextAndPicButton(String filename, String text) {

		setHorizontalTextPosition(SwingConstants.CENTER);
		setVerticalTextPosition(SwingConstants.BOTTOM);
		setText(text);
		icon = new ImageIcon(filename);
		labImage = new JButton(icon);
		if (icon != null) {
			setIcon(icon);
		}
	}
	public void setTextAndPic(String filename, String text){
		setHorizontalTextPosition(SwingConstants.CENTER);
		setVerticalTextPosition(SwingConstants.BOTTOM);
		setText(text);
		icon = new ImageIcon(filename);
		labImage = new JButton(icon);
		if (icon != null) {
			setIcon(icon);
		}
	}
}
